﻿<script>
	$(function(){
		/*var uri = "${pageContext.request.requestURI}";
		var i = uri.lastIndexOf("/"); 
		var len = uri.length;
		var page = uri.substring(i + 1, len);
		i = page.lastIndexOf(".");
		page = page.substring(0, i).trim();
		if(page === "news"){
			$("#"+page).attr("class", "active");
		}else if(page === "documents"){
			$("#"+page).attr("class", "active");
		}else if(page === "relativeWebsites"){
			$("#"+page).attr("class", "active");
		}else if(page === "relativePrograms"){
			$("#"+page).attr("class", "active");
		}else if(page === "account"){
			$("#"+page).attr("class", "active");
		}else{
		}*/
		
		$("#menu li").click(function(e){
			var a = $(this).find("a");
			var href = a.attr("href");
			var id = a.attr("id");
			if(id === "logout"){
				$("#alertDlg").dialog({
					height: 300,
					width: 350,
					modal: true,
					buttons: {
						Ok: function() {
							window.location = "${pageContext.request.contextPath}/backdoor/logout";
							$(this).dialog("close");
						},
						Cancel: function(){
							$(this).dialog("close");
						}
					}
				});
				return false;
			}
			
			window.location = href;
			return false;
		});
		
		$.alert = function(msg){
			$("#alertMsg").html(msg);
			$("#alertDlg").dialog({
				height: 300,
				width: 350,
				modal: true,
				buttons: {
					Ok: function() {
						$(this).dialog("close");
					}
				}
			});
		};
	});
</script>
<div class="nav">
	<ul>
		<!-- <li><a href='#'><span>Fund Management</span></a></li>-->
		<li class="active"><a href='#'><span>สรุปสถานะผลการเบิกจ่าย</span></a></li>
		<!-- <li><a href='#'><span>Track Spending</span></a></li>
		<li><a href='#'><span>Forecast your spending</span></a></li>
		<li><a href='#'><span>Track Appeal</span></a></li>
		<li><a href='#'><span>Track Deny</span></a></li>-->
	</ul>
</div>

<div id="logoutDlg" style="display:none;">
	<form action="">
		<div class="fg-black" style="text-align: center;">
			<div style="margin: 30px; margin-top: 10px;">ต้องการออกจากระบบ?</div>
			<!-- <div>
				<button id="btnLogout" name="btnLogout">Logout</button>
				<button id="btnCancel">Cancel</button>
			</div>-->
		</div>
	</form>
</div>	
<div id="alertDlg" style="display:none;">
	<div class="fg-black" style="text-align: center;">
		<div style="margin: 30px; margin-top: 10px;" id="alertMsg"></div>
	</div>
</div>